﻿using System;
using System.Reflection;
using System.Web.UI;

namespace Ue.Infrastructure.UI.SkinnedControls.PartAutoMappings
{
    public class MappingEntry
    {
        private readonly Func<Control> targetAcquire;

        public MappingEntry(Func<Control> targetAcquire, PropertyChain propertyChain, string formatString)
        {
            this.targetAcquire = targetAcquire;
            this.PropertChain = propertyChain;
            this.FormatString = formatString;
        }

        public Control Target
        {
            get { return this.targetAcquire(); }
        }

        public string FormatString { get; private set; }

        //public PropertyInfo Property { get; private set; }

        public PropertyChain PropertChain { get; private set; }
    }

    public class PropertyChain
    {
        public PropertyChain(PropertyInfo property)
        {
            this.Property = property;
        }

        public PropertyInfo Property { get; set; }

        public PropertyChain Childen { get; set; }
    }
}
